package com.cg.controller;

import com.cg.client.ItemClient;
import com.cg.dto.AddItemCommentDto;
import com.cg.dto.Dto;
import com.cg.dto.ItemRecommendDto;
import com.cg.vo.ItemRecommendVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/v")
public class ItemVController {


    @Resource
    private ItemClient itemClient;


    //添加评论
    @PostMapping("/commitItemComment")
    public Dto addItemComment(HttpServletRequest request, @RequestBody AddItemCommentDto addItemCommentDto){
        String token = request.getHeader("token");
        addItemCommentDto.setToken(token);
        return itemClient.addItemComment(addItemCommentDto);
    }



}
